package com.mr.productclient.api;

import com.mr.productclient.entity.ProductInfo;
import com.mr.productclient.vo.CartVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
* User (作者): MRui
* TODO (描述)：对商品服务开放的接口api
* Data：2018-11-04 17:48
*/
@Component
@FeignClient(name = "productclient")
public interface ProductForOrderApi {

    /**
    * User (作者): MRui
    * TODO (描述)：取商品list
    * Data：2018-11-04 18:08
    */
    @PostMapping("/findList")
    List<ProductInfo> findList(@RequestBody List<String> ids);

    /**
    * User (作者): MRui
    * TODO (描述)：减库存
    * Data：2018-11-04 23:16
    */
    @PostMapping("/decreaseStock")
    void decreaseStock(@RequestBody List<CartVO> cartVOList);
}
